package com.woniu.p2p.behindServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.p2p.behindService.CustomerManagerService;
import com.woniu.p2p.entity.User;
import com.woniu.p2p.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * UserManagerServiceImpl
 *
 * @author 郭耀文
 * @date 2020/8/11
 */
@Service
public class CustomerManagerServiceImpl implements CustomerManagerService {

    @Autowired
    UserMapper userMapper;



    @Override
    public PageInfo<User> findUserByName(String name, Integer start) {
        PageHelper.startPage(start,3);
        List<User> users = userMapper.findByUserName(name);
        PageInfo<User> pageInfo=new PageInfo<>(users);
        return pageInfo;
    }

    @Override
    public List<User> lookListUsersByName(String name) {
        return userMapper.findByUserName(name);
    }
}
